package com.song.druid.annotation;

import com.song.druid.config.RegexValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Documented
@Constraint(validatedBy = RegexValidator.class)
public @interface ParamRegex {
    String pattern() default "";

    String message() default "参数格式错误";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
